# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=perl-http-parser-xs
_pkgname=HTTP-Parser-XS
pkgver=0.17
pkgrel=12
pkgdesc='A fast, primitive HTTP request parser.'
arch=('x86_64' 'aarch64')
license=('PerlArtistic' 'GPL')
options=('!emptydirs')
depends=('perl')
makedepends=('perl-module-install')
url='http://search.cpan.org/dist/HTTP-Parser-XS'
source=("http://search.cpan.org/CPAN/authors/id/K/KA/KAZUHO/$_pkgname-$pkgver.tar.gz")
sha512sums=('44375b93e8aea04bedee283b1796eb6e94a2920be7ae29fe2f7d83491005b4d8f29047ddf52c6d7f62cf5a9f2575d7f6ea7d357e178536f60dd2c3cee08f495e')
_distdir="$_pkgname-$pkgver"

build() {
  ( export PERL_MM_USE_DEFAULT=1 PERL5LIB=""                 \
      PERL_AUTOINSTALL=--skipdeps                            \
      PERL_MM_OPT="INSTALLDIRS=vendor DESTDIR='$pkgdir'"     \
      PERL_MB_OPT="--installdirs vendor --destdir '$pkgdir'" \
      MODULEBUILDRC=/dev/null

    cd $_distdir

    /usr/bin/perl Makefile.PL

    make
  )
}

package() {
  cd $_distdir

  make install
}

